import request from "@/utils/request"

export function getArticleBackById(articleId) {
    return request({
        url:'/admin/articles/'+articleId,
        method:'get'
    })
}

export function listCategoriesBySearch() {
    return request({
        url:'/admin/categories/search',
        method:'get'
    })
}

export function listTagsBySearch(){
    return request({
        url:'/admin/tags/search',
        method:'get'
    })
}

export function  saveArticleImages(formdata){
    return request({
        url:'/admin/articles/images',
        method:'post',
        data:formdata
    })
}

export function saveOrUpdateArticle(data){
    return request({
        url:'/admin/articles',
        method:'post',
        data:data
    })
}

export function categoriesBySearch(keywords) {
    return request({
        url:'/admin/categories/search',
        method:'get',
        params:{keywords}
    })
}

export function tagsBySearch(keywords){
    return request({
        url:'/admin/tags/search',
        method:'get',
        params:{keywords}
    })
}
